# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=appstream-glib
pkgver=0.7.18
pkgrel=2
pkgdesc="Objects and methods for reading and writing AppStream metadata"
url="https://people.freedesktop.org/~hughsient/appstream-glib/"
arch=(x86_64)
license=(LGPL)
depends=(gtk3 libyaml pacman gcab libsoup libstemmer)
makedepends=(gobject-introspection gtk-doc git gperf meson)
provides=(appdata-tools libappstream-glib.so)
conflicts=(appdata-tools)
replaces=(appdata-tools)
_commit=705e8e2061e9c9ef741792b1de56c6529fb57082  # tags/appstream_glib_0_7_18^0
source=("git+https://github.com/hughsie/appstream-glib#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^appstream_glib_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build \
    -D alpm=true \
    -D gtk-doc=true \
    -D rpm=false
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  DESTDIR="$pkgdir" meson install -C build
}
